import React,{Component} from 'react';
import Header from '../../../system/header/Header';
import Footer from '../../../component/footer/Footer';
import ajax from '../../../component/httprequest/Request';
import ReactHtmlParser from 'react-html-parser';
import queryString from 'query-string';
import './details.less';
const prefix = 'solution_details';
class Details extends Component{
    state={
      content:''
    };
    componentWillMount(){
        let page = queryString.parse(this.props.location.search).page;
        ajax.ajaxRequest('get',`../solutionDetails/${page}/${page}.html`,null,()=>{})
            .then(res=>{
                this.setState({
                    content:ReactHtmlParser(res.data)
                })
            })
            .catch(err=>{
                console.log(err)
            });
    };
    render(){
        let {content} = this.state;
        return(
            <div>
                <Header refName="solution" childNodes="solution-a" imgUrl={require('../../img/solution.jpg')}/>
                <div className={prefix+'-content'}>
                    {content}
                </div>
                <Footer/>
            </div>
        )
    }
}
export default Details;